﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="addHotQuestion.aspx.cs" Inherits="Admin_addHotQuestion" %>
<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
</head>
<body onload='$("#loading").hide()'>
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div> 
    <form name="addform" id="addformAjax"  method="post">
    <div class="container" id="cpcontainer">   
   <table class="tb">
        <tr class="thead" ><td colspan="4">
            新闻添加(<font color='red'>＊</font>为必填,其它选填)</td>
            <td colspan="1">
            </td>
        </tr>
        <tr>
            <td width="12%" style="height: 31px" align="center">
                热门问题标题：</td>
            <td colspan="3" style="height: 31px">
                <input id="hqTitle" name="hqTitle" type="text" style="width: 500px" runat="server" />
                &nbsp;<font color='red'>＊<input id="hqid_hid" name="hqid_hid" runat="server" type="hidden" /></font><span id="m_name_ok"></span></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
       <tr>
           <td colspan="4" align="center">
           </td>
           <td colspan="1">
           </td>
       </tr>
        <tr>
            <td style="height: 31px" align="center">
                热门问题回答：</td>
            <td colspan="3" style="height: 31px"><fckeditorv2:fckeditor id="FCKeditor1" runat="server" height="300px" toolbarset="Zrnet" width="650px" ></fckeditorv2:fckeditor></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
        <tr>          
      <td width="6%"></td>
      <td class="forumRow" style="height: 27px" ><input type="button" class="btn" value="确认保存" name="Submit" id="tijiao"  />&nbsp;<input type="reset" class="btn" value="清 除"  onclick="resetCon('FCKeditor1')"/>&nbsp;<input type="button" class="btn" value="返　回" onclick="javascript:location.href='adminHotQuestion.aspx';"/></td>
        </tr>
    </table>    
<script type="text/javascript">
function resetCon(source) {
    //document.addform.reset();
    var oEditor=FCKeditorAPI.GetInstance(source).EditorDocument.body.innerHTML="";
    return false;
}
</script>
<script type="text/javascript">
$(document).ready(function(){   
    var bo=true;       
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url: "addHotQuestion.aspx?action=submit"+$("#hqid_hid").attr("value"),   
        // override for form's 'action' attribute 
        // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
        var hqTitle=$("#hqTitle").attr("value");           
        if(hqTitle=="")
        {
            alert("请填写问题标题！");
            bo=false;
        }       
         if(bo)
         {        
            $("#loading").show();    
            var oEditor = FCKeditorAPI.GetInstance("FCKeditor1") ;   
            oEditor.UpdateLinkedField(); 
            $('#addformAjax').ajaxSubmit(options); 
            return false;
         }        
    });
})
function showResponse(msg)
{ 
    if(msg=="2")
    {
        alert("热门问题回答不能为空！");
    }
    else
    {
         alert(msg);
         resetCon('FCKeditor1');
         $("#hqTitle").attr("value","");
         $("#hqid_hid").attr("value","");
    }  
    $("#loading").hide();
}

function showRequest(formData, jqForm, options)
 { 		
    return true; 
} 
</script>
 </div>
<uc1:adminfoot ID="Adminfoot1" runat="server" />
    </form>

</body>
</html>
